<?php
require_once('dao.php');

$lc = DAOFactory::getPA9DAO()->queryBySeg(0);
$sh = DAOFactory::getSubHeadingDAO()->load($lc[0]->sH);
$des = DAOFactory::getDescriptionDAO()->load($lc[0]->dES);
?>
<?php include_once 'include/header.php'; ?>

<div class="main_wrapper">
    <div class="main_container">

        <div class="left_wrapper">
            <h2> <?php echo $sess->TVar($mh4->textEn, $mh4->textSv); ?> </h2>
            <h3> <?php echo $sess->TVar($sh->textEn, $sh->textSv); ?> </h3>
            <p>
                <?php echo c_to_html($sess->TVar($des->textEn, $des->textSv)); ?>
            </p>
        </div>
       <div class="right_wrapper bocker_wrapper">
           <div class="bok">
            <?php
            $pc = DAOFactory::getPA9DAO()->queryBySeg(1);
            foreach ($pc as $key => $value):
                $sh = DAOFactory::getSubHeadingDAO()->load($value->sH);
                $img = DAOFactory::getImageDAO()->load($value->iMAGE);
                $des = DAOFactory::getDescriptionDAO()->load($value->dES);
                $link = DAOFactory::getUrlLinkDAO()->load($value->lINK);
                ?>
               
               <?php
                if (!empty($img->name)):
                    ?>
                    <img src='<?php echo IMAGE_PATH . $img->name; ?>' width="213" height="289"/>
                    <?php
                endif;
                ?>
                    
               <h2><?php echo $sess->TVar($sh->textEn, $sh->textSv); ?></h2>
               
                <p>
                    <?php echo c_to_html($sess->TVar($des->textEn, $des->textSv)); ?>
                  
                </p>
                <a href="<?php echo 'http://'.c_to_html($sess->TVar($link->linkEn, $link->linkSv));  ?>" target="_blank"> <?php echo c_to_html($sess->TVar($link->linkEn, $link->linkSv));  ?> </a>
                
                </div>

                <?php
            endforeach;
            ?>
        </div>
    </div>
    <div id="main_shadow"></div>
</div>

<?php include_once 'include/footer.php'; ?>